package com.ccb.sc.goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ccb.sc.goods.vo.AppGoodsListVo;
import com.ccb.sc.common.modules.goods.entity.Goods;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.ibatis.annotations.Param;

/**
 * @author ken
 * @version 1.0
 * @date 2020-09-21
 */
public interface AppGoodsMapper extends BaseMapper<Goods> {

    Page<AppGoodsListVo> selectByQueryParam(Page<Goods> page, @Param("params") QueryParam params);

    @Data
    @Accessors(chain = true)
    class QueryParam {

        private Long memberId;

        /**
         * 0:全部商品 1我能兑换 2人气排行 3热门待补货 4新品到货
         */
        private int category;

        private String key;

        private String orderBy;

        private String direction;
    }
}
